package com.happyclub.pojo;

import javax.persistence.Column;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Objects;

/**
 * @author 高欢
 * @description TODO
 * @date 2019/4/4
 */
public class TbRolePowerPK implements Serializable {
    private String roleId;
    private String powerId;

    @Column(name = "ROLE_ID")
    @Id
    public String getRoleId() {
        return roleId;
    }

    public void setRoleId(String roleId) {
        this.roleId = roleId;
    }

    @Column(name = "POWER_ID")
    @Id
    public String getPowerId() {
        return powerId;
    }

    public void setPowerId(String powerId) {
        this.powerId = powerId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbRolePowerPK that = (TbRolePowerPK) o;
        return Objects.equals(roleId, that.roleId) &&
                Objects.equals(powerId, that.powerId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(roleId, powerId);
    }
}
